//
//  HomeStrategyHeadView.m
//  GiftNote
//
//  Created by lanou on 15/8/17.
//  Copyright (c) 2015年 GN. All rights reserved.
//

#define kGap 10

#import "HomeStrategyHeadView.h"
#import "HomeHeader.h"
#import "UIImageView+WebCache.h"

@implementation HomeStrategyHeadView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(kGap, kGap, kGap * 4, kGap * 4)];
        [self addSubview:_imageView];
        
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_imageView.frame) + 5, _imageView.frame.origin.y, kHomeWidth / 2, _imageView.frame.size.height / 2)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self addSubview:_titleLabel];
        
        
        _detailLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleLabel.frame.origin.x, CGRectGetMaxY(_titleLabel.frame) + 10, kHomeWidth / 2, kGap)];
        _detailLabel.font = [UIFont systemFontOfSize:10];
        [self addSubview:_detailLabel];
        
    }
    return self;
}


- (void)setStrategyModel:(HomeStrategyModel *)strategyModel
{
    _strategyModel = strategyModel;
    [_imageView sd_setImageWithURL:[NSURL URLWithString:_strategyModel.icon_url] placeholderImage:nil];
    _titleLabel.text = _strategyModel.name;
    _detailLabel.text = _strategyModel.desc;
}

@end







